package cn.udrm.water.base.v1.waterdelivery.dto;

import java.util.List;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import cn.udrm.water.base.v1.waterdelivery.entities.CanalSystem;

@Mapper(componentModel="spring")
public interface CanalSystemDtoMapper {
	
	@Mappings({
		@Mapping(source="parent.id", target="parentGuid"),
		@Mapping(source="parent.name", target="parentName"),
		@Mapping(source="canalSystemExt.id", target="canalSystemExtGuid"),
		@Mapping(source="canalSystemExt.managerUnitGuid", target="canalSystemExtManagerUnitGuid"),
		@Mapping(source="canalSystemExt.managerUnitName", target="canalSystemExtManagerUnitName")
	})
	public CanalSystemDto from(CanalSystem canalSystem);
	public CanalSystem fromCanalSystemDto(CanalSystemDto canalSystemDto);
	/*@Mappings({
		@Mapping(source="CanalSystemExt", target="CanalSystemExtDto")
	})*/
	public List<CanalSystemDto> from(List<CanalSystem> canalSystems);
}
